@extends('layouts.master')

@section('title')
    林场录入——木投网商城管理后台
@stop

@section('app_css')
    <link rel="stylesheet" href="/resource/css/bootstrap.min.css">
    <link rel="stylesheet" href="/resource/css/font-awesome.min.css">
    <link rel="stylesheet" href="/resource/css/animate.min.css">
    <link rel="stylesheet" href="/resource/css/custom.css">
    <link rel="stylesheet" href="/resource/css/green.css">
    <link rel="stylesheet" href="/resource/css/fileinput.min.css">
@stop

@section('app_js')
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="/resource/js/jquery.min.js"></script>
    <script src="/resource/js/bootstrap.min.js"></script>
    <script src="/resource/js/custom.js"></script>
    <!-- icheck -->
    <script src="/resource/js/icheck.min.js"></script>
    <!-- Datatables -->
    <script src="/resource/js/jquery.dataTables.js"></script>
    <script src="/resource/js/J_main.js"></script>
    <!-- 添加图片 -->
    <script src="/resource/js/fileinput.min.js"></script>
    <script src="/resource/js/fileinput_locale_zh.js"></script>
    <!-- 编辑器 -->
    <!-- 编辑器 -->
    <script src="/resource/js/umeditor.config.js" charset="utf-8"></script>
    <script src="/resource/js/umeditor.min.js" charset="utf-8"></script>
    <script src="/resource/js/lang/zh-cn/zh-cn.js"></script>
    <script>
        var um = UM.getEditor('editor');
    </script>
    <link rel="stylesheet" href="/resource/js/themes/default/css/umeditor.css">
@stop

@section('content')
    <body class="nav-md">

    <div class="container body">


        <div class="main_container">

            @include('common.admin_menu')

            <!-- top navigation -->
            @include('common.admin_nav')
            <!-- /top navigation -->


            <!-- page content -->
            <div class="right_col" role="main">

                <div class="">

                    <div class="row cont">

                        <div class="col-md-6 col-sm-12 col-xs-12">
                            <div class="x_panel">
                                <div class="x_title">
                                    <h2>林场录入 <small>林场服务</small></h2>
                                    <div class="clearfix"></div>
                                </div>


                                <div class="x_content">
                                    <br />


                                    @if(empty($forest))
                                        {{ Form::open(['url'=>'/edit_forest', 'files' => true, 'method' => 'post']) }}
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="first-name">林场名称
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" id="first-name" required="required" class="form-control col-md-7 col-xs-12" name="forest_name">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">国家
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" id="last-name" required="required" class="form-control col-md-7 col-xs-12 "name="country">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">品类</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="product_cate">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">林场类型</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <select class="form-control" name="type">
                                                    <option value="0">海内</option>
                                                    <option  value="1">海外</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">展示图1</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="file" class="file form-control col-md-7 col-xs-12" name="show_pic1">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">展示图2</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="file" class="file form-control col-md-7 col-xs-12" name="show_pic2">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">展示图3</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="file" class="file form-control col-md-7 col-xs-12" name="show_pic3">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">文章内容</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <script id="editor" type="text/plain" style="width:100%" name="introduce"></script>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">视频</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="file" class="file form-control col-md-7 col-xs-12" name="video">
                                            </div>
                                        </div>
                                        <div class="ln_solid"></div>
                                        <div class="form-group">
                                            <div class="col-md-10 col-sm-10 col-xs-12 col-md-offset-3">
                                                <button type="submit" class="btn btn-primary">取消</button>
                                                <button type="submit" class="btn btn-success">提交</button>
                                            </div>
                                        </div>
                                        {{ Form::close() }}
                                        @else
                                        {{ Form::open(['url'=>'/edit_forest', 'files' => true, 'method' => 'post']) }}
                                        <input type="hidden" value="{{$forest->forest_id}}" name="forest_id">
                                        <input type="hidden" name="show_pic1_old" value="{{$forest->show_pic1}}">
                                        <input type="hidden" name="show_pic2_old" value="{{$forest->show_pic2}}">
                                        <input type="hidden" name="show_pic3_old" value="{{$forest->show_pic3}}">
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="first-name">林场名称
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" id="first-name" required="required" class="form-control col-md-7 col-xs-12" name="forest_name" value="{{$forest->forest_name}}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-2 col-sm-2 col-xs-12" for="last-name">国家
                                            </label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="text" id="last-name" required="required" class="form-control col-md-7 col-xs-12 "name="country" value="{{$forest->country}}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">品类</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input id="middle-name" class="form-control col-md-7 col-xs-12" type="text" name="product_cate" value="{{$forest->product_cate}}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">林场类型</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <select class="form-control" name="type" value="{{$forest->type}}">
                                                    <option value="0">海内</option>
                                                    <option  value="1">海外</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">展示图1</label>

                                            <div class="col-md-10 col-sm-10 col-xs-12">

                                                <input type="file" id ="show_pic1" class="file form-control col-md-7 col-xs-12" name="show_pic1" value="{{$forest->show_pic1}}">
                                            </div>
                                            <div><img src="{{$forest->show_pic1}}" height="100" weight="100"></div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">展示图2</label>

                                            <div class="col-md-10 col-sm-10 col-xs-12">

                                                <input type="file" id ="show_pic2" class="file form-control col-md-7 col-xs-12" name="show_pic2" value="{{$forest->show_pic2}}">
                                            </div>
                                            <div><img src="{{$forest->show_pic2}}" height="100" weight="100"></div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">展示图3</label>

                                            <div class="col-md-10 col-sm-10 col-xs-12">

                                                <input type="file" id ="show_pic3" class="file form-control col-md-7 col-xs-12" name="show_pic3" value="{{$forest->show_pic3}}">
                                            </div>
                                            <div><img src="{{$forest->show_pic3}}" height="100" weight="100"></div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">文章内容</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <script id="editor" type="text/plain" style="width:100%" name="introduce">{{$forest->introduce}}</script>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-2 col-sm-2 col-xs-12">视频</label>
                                            <div class="col-md-10 col-sm-10 col-xs-12">
                                                <input type="file" class="file form-control col-md-7 col-xs-12" name="video" >
                                            </div>
                                        </div>
                                        <div class="ln_solid"></div>
                                        <div class="form-group">
                                            <div class="col-md-10 col-sm-10 col-xs-12 col-md-offset-3">
                                                <button type="submit" class="btn btn-primary">取消</button>
                                                <button type="submit" class="btn btn-success">提交</button>
                                            </div>
                                        </div>
                                        {{ Form::close() }}
                                        @endif



                                </div>
                            </div>
                        </div>

                        <br />
                        <br />
                        <br />

                    </div>
                </div>

                <!-- footer content -->

                <footer>
                    <div class="">
                        <p class="pull-right">Copyright 2016 mutouw.com All rights reserved. |
                            <span class="lead"> <i class="fa fa-logo-footer"></i> 木投网后台管理系统</span>
                        </p>
                    </div>
                    <div class="clearfix"></div>
                </footer>
                <!-- /footer content -->
            </div>
            <!-- /page content -->

        </div>
    </div>

    <div id="custom_notifications" class="custom-notifications dsp_none">
        <ul class="list-unstyled notifications clearfix" data-tabbed_notifications="notif-group">
        </ul>
        <div class="clearfix"></div>
        <div id="notif-group" class="tabbed_notifications"></div>
    </div>
    </body>
@stop